<div class="page_title">添加用户</div>
<div id="add_user_wrap">
<?php 
if(!($data instanceof UserBean))
	unset($data);
?>
	<form action="<?php echo urlToAction("user", "adduser")?>">
	<div class="line1">
		<div class="field_name">用户名：</div>
		<input type="text" value="<?php if(isset($data)) echo $data->username;?>" name="username" id="" />
	</div>
	<div class="line2">
		<div class="field_name">密码：</div>
		<input type="password" name="password" id="" />
	</div>
	<div class="line2">
		<div class="field_name">真实姓名：</div>
		<input type="text" value="<?php if(isset($data)) echo $data->name;?>" name="name" id="" />
	</div>
	
	<div class="line3">
		<div class="field_name">用户类型：</div>
		<select name="type" id="type_select">
			<option <?php if (isset($data)) if($data->type==UserBean::$_INSTITUE) echo "selected='selected";?> value="<?php echo UserBean::$_INSTITUE?>">院系</option>
			<option <?php if (isset($data)) if($data->type==UserBean::$_SENATE) echo "selected='selected";?> value="<?php echo UserBean::$_SENATE?>">教务处</option>
			<option <?php if (isset($data)) if($data->type==UserBean::$_ADMIN) echo "selected='selected";?> value="<?php echo UserBean::$_ADMIN?>">管理员</option>
		</select>
	</div>
	<div class="line4">
		<div class="field_name">院系：</div>
		<select name='department' class='select_style' id="department_select">
			<?php foreach(getInstitutes() as $key => $value):?>
			<option value='<?php echo $key;?>' <?php if (isset($data)) if($data->department==$key) echo "selected='selected";?>><?php echo $value;?></option>
			<?php endforeach;?>
		</select>
	</div>
	<div class="line5">
		<div class="field_name">电话：</div>
		<input type="text" value="<?php if(isset($data)) echo $data->phone;?>" name="phone" id="" class="not-required" />
	</div>
	<div class="line6">
		<div class="field_name">邮箱：</div>
		<input type="text" value="<?php if(isset($data)) echo $data->email;?>" name="email" id="" class="not-required"/>
	</div>
	<div class="line7">
		<div class="field_name">传真：</div>
		<input type="text" value="<?php if(isset($data)) echo $data->fax;?>" name="fax" id="" class="not-required"/>
	</div>
	<?php if (isset($data)):?>
	<input type="hidden" value="" name="id"/>
	<?php endif;?>
	<div class="operator">
		<div class ="form_post button">提交</div>
	</div>
	
	
	</form>

</div>